package com.zelin.controller;

import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by WF on 2020/8/3 15:09
 */
@RestController
@RequestMapping("consumer")
public class ConsumerController {
    @Autowired
    private RestTemplate restTemplate;
    public static final String URL = "http://tensquare-base-nacos";
    @GetMapping
    public Result list(){
        return restTemplate.getForObject(URL + "/nacos/hello",Result.class);
    }
}
